package com.kehong.json;

import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;

/**
 * @author zhang peng yang ming
 * @CopyRight (C) http://www.csdn.com
 * @brief
 * @email 122162005@qq.com
 * @date 2018-07-12
 */
public class JsonDemo {
    public String name = "rose";
    private String sex = "男";
    public static void main(String[] args) throws NoSuchFieldException, IllegalAccessException {
        Class clazz = JsonDemo.class;
        Field[] fields = clazz.getDeclaredFields();
        JsonDemo jsonDemo = new JsonDemo();
        for (Field field : fields) {
            System.out.println(field.get(jsonDemo));
        }
//        Map map = new HashMap();
//        map.getClass().getFields();
//        map.put("username", "jack");
//        map.put("name", "jack");
//        System.out.println(map);
//        System.out.println("{" + "key" + ":" + map.get("key") + ", name" + ":" + map.get("name") + "}");
    }
}
